<template>
	<view class="page flexC-FS-C">
		<view class="top flexC-FS-C">
			<view class="box flexR-FS-C">
				<view class="box-item flexC-FS-C">
					<view class="width100 height38 flexR-FS-C">
						<view class="EHSbtn">
							<u--image :src="imagesYqgjUrl + 'time2.png'" width="46rpx" height="46rpx"></u--image>
						</view>
						<text class="msg-content-title ">来访时间：</text>
						<text class="datetime msg-content-title">{{date_val}}</text>
					</view>
					<view class="width100 height38 flexR-FS-C">
						<view class="EHSbtn">
							<u--image :src="imagesYqgjUrl + 'date2.png'" width="46rpx" height="46rpx"></u--image>
						</view>
						<text class="msg-content-title">结束时间：</text>
						<text class="datetime msg-content-title">{{date_ed}}</text>
					</view>
				</view>
			</view>
		</view>

		<view class="modules flexC-FS-C">
			<view class="swiper-scroll-view">
				<view class="order-item flexC-FS-SB" v-for="(item, el) in dataList" :key="el">
					<view class="msg flexR-FS-FS">
						<view class="left">
							<img class="faces" :src="imagesYqgjUrl + 'head.png'" @click="headImageClick(faceUrl)"></img>
						</view>
						<view class="right">
							<view class="width100 height30 flexC-FS-FS">
								<view class="msg-content flexR-FS-C mb10">
									<text class="txt19">{{ item.visitorName }}</text>
								</view>
							</view>
							<view class="width100 height30 flexR-FS-C">
								<view class="EHSbtn">
									<u--image :src="imagesYqgjUrl + 'phone.png'" width="46rpx"
										height="46rpx"></u--image>
								</view>
								<text class="msg-content-title ">手机：</text>
								<text class="msg-content-title">{{ item.visitorPhone }}</text>
							</view>
							<view class="width100 height30 flexR-FS-C">
								<view class="EHSbtn">
									<u--image :src="imagesYqgjUrl + 'card.png'" width="46rpx" height="46rpx"></u--image>
								</view>
								<text class="msg-content-title">身份证：</text>
								<text class="msg-content-title">{{ item.visitorIdCardNo }}</text>
							</view>
							<view class="width100 height30 flexR-FS-C">
								<view class="EHSbtn">
									<u--image :src="imagesYqgjUrl + 'date.png'" width="46rpx" height="46rpx"></u--image>
								</view>
								<text class="msg-content-title">状态：</text>
								<text :class="'msg-content-title '+'color'+item.state">结束</text>
								<text :class="'msg-content-title '+'color'+item.state"
									v-if="item.visitorIdCardNo && item.state==10">（退回）</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="btn flexC-Cen" @click="btnBack">返回</view>
	</view>
</template>

<script>
	import config from '@/configs/index.js'

	export default {
		data() {
			return {
				imagesYqgjUrl: config.IMAGES_URL_YQGJ + 'visitor/',
				detailid: '',
				date_val: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
				date_ed: "08:00-16:00",
				dataList: [{
					visitorName: "张扬",
					visitorPhone: "13910909890",
					visitorIdCardNo: "638987676567656545",
				}, {
					visitorName: "范晓云",
					visitorPhone: "13916588888",
					visitorIdCardNo: "638987676567656545",
				}],
				faceUrl: '',
			};
		},
		onShow() {
			this.startInit();
		},
		onLoad(options) {
			this.detailid = options.data;
		},
		methods: {
			startInit() {
				// this.getVisitList();
			},
			getVisitList() {
				const params = {
					id: this.detailid
				};
				let that = this;
				this.dataList = [];
			},
			headImageClick(url) {
				this.handleShowPic([url])
			},
			// 展示照片
			handleShowPic(list) {
				uni.previewImage({
					current: 0,
					indicator: 'number',
					loop: true,
					urls: list
				});
			},
			btnBack() {
				uni.navigateTo({
					url: '/sub-visitor/histroy'
				});
			},
		}
	};
</script>

<style scoped lang="scss">
	.page {
		width: 100%;
		height: 100%;
		background-color: #f5f5f5;

		.top {
			width: 100%;
			padding: 0 34rpx 0px 34rpx;
			height: 200rpx;
			box-sizing: border-box;
			padding-bottom: 20rpx;
			margin-top: 34rpx;

			.box {
				width: 100%;
				height: 100%;
				background: #41ae68;
				border-radius: 6rpx;
				color: #ffffff;
				font-size: 30rpx;

				.box-item {
					margin: 0 38rpx 0;

					.height38 {
						height: 76rpx;
					}

					.msg-content-title {
						white-space: nowrap;
						width: 136rpx;
						margin-left: 20rpx;
						height: 52rpx;
						line-height: 52rpx;
					}

					.msg-content-text {
						white-space: nowrap;
						width: 96rpx;
						margin-left: 20rpx;
						height: 52rpx;
						line-height: 52rpx;
					}

					.datetime {
						font-size: 30rpx;
					}
				}
			}
		}

		.modules {
			width: 100%;
			padding: 0 34rpx 0px 34rpx;
			height: calc(100% - 440rpx);
			box-sizing: border-box;
			padding-bottom: 20rpx;
			margin-top: 4rpx;

			.swiper-scroll-view {
				width: 100%;
				height: 100%;

				.order-item {
					width: 100%;
					margin: 0 0 0;
					background-color: #ffffff;
					padding: 20rpx 10rpx;
					border-radius: 6rpx;
					box-sizing: border-box;
					box-shadow:  0 1.93465px 7.73859px 0 rgba(0,0,0,0.15);
					margin-bottom: 28rpx;

					.msg {
						width: 100%;

						.left {
							margin-top: 14rpx;

							.faces {
								width: 98rpx;
								height: 98rpx;
								border-radius: 50%;
							}
						}

						.right {
							margin-left: 24rpx;
							margin-top: 20rpx;

							.EHSbtn {
								margin-right: 10rpx;
							}

							.txt19 {
								font-size: 34rpx;
							}

							.height30 {
								height: 64rpx;
							}

							.msg-content-title {
								white-space: nowrap;
								font-size: 28rpx;
								margin-left: 0rpx;
								height: 52rpx;
								line-height: 52rpx;
							}

							.color10 {
								color: #DC143C;
							}

							.color20 {
								color: #FF8C00;
							}

							.color30 {
								color: green;
							}

							.color40 {
								color: black;
							}
						}

						.msg-content {
							width: 100%;
							font-size: 28rpx;
							font-weight: 500;
							color: #333333;
						}
					}
				}
			}
		}

		.btn {
			width: 530rpx;
			height: 72rpx;
			margin: 0 auto;
			border-radius: 8rpx;
			color: #ffffff;
			background-color: rgba(65, 174, 104, 1);
			font-size: 30rpx;
		}

		.visitorbox {
			width: 100%;
			background-color: #ffffff;
			width: 100%;
			position: absolute;
			bottom: 0rpx;
			height: 140rpx;
		}
	}

	.animatedTime {
		animation-duration: 300ms;
	}
</style>